# $Id: CMakeLists.txt 38 2009-01-12 00:10:53Z rodlima $

include(PCHSupport)

add_library(cppobj object.cpp ident.cpp list.cpp query.cpp db.cpp util.cpp  
            recursion_guard.cpp enable_shared_from_this.cpp text_archive.cpp 
            visitor.cpp invariants.cpp assert.cpp document.cpp cache.cpp 
            metainfo.cpp relations.cpp  generic_relation.cpp type_traits.cpp
            filter.cpp)
set_target_properties(cppobj PROPERTIES VERSION ${VERSION} 
                                        SOVERSION ${SOVERSION}
					DEBUG_POSTFIX d)

target_link_libraries(cppobj ${Boost_SERIALIZATION_LIBRARY}
    ${Boost_REGEX_LIBRARY} ${Boost_DATE_TIME_LIBRARY}
    ${Boost_THREAD_LIBRARY} ${PQXX_LIBRARIES})
include_directories(cppobj ${Boost_INCLUDE_DIRS})

install(TARGETS cppobj EXPORT cppobjects
        DESTINATION lib
	LIBRARY COMPONENT runtime
	ARCHIVE COMPONENT development)

install(FILES object.h ident.h list.h query.h db.h util.h recursion_guard.h
	      enable_shared_from_this.h text_oarchive.h visitor.h invariants.h
	      assert.h document.h cache.h metainfo.h relations.h
	      relation_base.h generic_relation.h relation_types.h
	      metainfo_base.h type_traits.h unique_ptr.h filter.h
	      update_type.h view.h util_pointer.h nullptr.h ptr_multimap.h
	      text_oarchive.h serialization.h
	DESTINATION include/orm
	COMPONENT development)

install(EXPORT cppobjects DESTINATION lib/cppobjects)

ADD_PRECOMPILED_HEADER(cppobj pch.h)
